<?php $this->load->view('common/admin_header');?>
<div class="block">
      <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <h2>語言設定</h2>
      </div>
      <!-- .block_head ends -->
      <div class="block_content">
        <p class="breadcrumb">目前位置 &raquo; <a href="<?=site_url('admins/index')?>">控制台</a> &raquo; 系統管理 &raquo; <strong>語言設定</strong></p>
        <?php $this->load->view('common/notify');?>
        <form action="<?=site_url('admins/languages')?>" method="get">
          <input type="hidden" name="field" value="<?=isset($field)?$field:'add_time'?>" id="field">
          <input type="hidden" name="sort" value="<?=isset($sort)?$sort:'asc'?>" id="sort">
          <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
            <thead>
              <tr>
                <th><a id="name" class="<?=isset($field) && $field=='name'?$sort:'';?>" href="#">語言</a></th>
                <th><a id="filename" class="<?=isset($field) && $field=='filename'?$sort:'';?>" href="#">資料夾</a></th>
                <th><a id="status" class="<?=isset($field) && $field=='status'?$sort:'';?>" href="#">狀態</a></th>
                <th><a id="sort_order" class="<?=isset($field) && $field=='sort_order'?$sort:'';?>" href="#">排序</a></th>
                <th style="text-align:center">動作</th>
              </tr>
            </thead>
            <tbody class="table">
              <?php if(isset($lists_count) && $lists_count>0):?>
              <?php foreach($lists->result_array() as $list):
                $urls=site_url('admins/languages/%s/'.$list['id']);
                $status=$list['status']==1?'啟用':'停用';
                $del=$defalut_language==$list['id']?'<b style="color:red">(預設)</b>':'';
              ?>
              <tr>
                <td><?=$list['name'].$del?></td>
                <td><?=$list['filename']?></td>
                <td><?=$status?></td>
                <td><?=$list['sort_order']?></td>
                <td class="listaction">
                  <a href="<?=sprintf($urls,"edit");?>" class="l_edit">編輯</a>
                  <?php if($defalut_language!=$list['id']):?>
                  <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete">刪除</a>
                  <?php endif;?>
                </td>
              </tr>
              <?php endforeach;?>
              <?php else:?>
              <tr>
                <td colspan="9" class="nodata"><p>沒有任何資料！</p></td>
              </tr>
              <?php endif;?>
            </tbody>
          </table>
          <!-- .tableactions ends -->
          <div id="pagination"><?php echo $pagination;?><div class="listscount">共有 <?=$lists_count?> 條記錄</div></div>
          <!-- .pagination ends -->
        </form>
      </div>
      <!-- .block_content ends -->
      <div class="bendl"></div>
      <div class="bendr"></div>
    </div>
    <!-- .block ends -->
<?php $this->load->view('common/admin_footer');?>
